package org.lion.jingbeifang_interviewquestions.calculatePrice.entity;

import lombok.Data;
import org.lion.jingbeifang_interviewquestions.calculatePrice.enums.GoodsItem;

import java.math.BigDecimal;

@Data
public class StrategySubtract {

    //满足的价格
    private BigDecimal x;
    //扣减的价格
    private BigDecimal y;

    public StrategySubtract(BigDecimal x, BigDecimal y){
        if (x.compareTo(y) == -1){
            throw new ArithmeticException("illegal rules!");
        }

        this.x = x;
        this.y = y;
    }


}
